#pragma once
#include <iostream>
#include <functional>
#include <pthread.h>
#include "InetAddr.hpp"
#include "socket.hpp"

using namespace socket_ns;
class tcp_server;
using io_server_t = std::function<void(socket_sptr sockfd, InetAddr client)>;

class thread_data
{
public:
    thread_data()
    {
    }
    ~thread_data()
    {
    }

private:
    socket_sptr _sockfd;
    InetAddr _client_addr;
    tcp_server *self;
};

class tcp_server
{
public:
    tcp_server(int port, io_server_t service)
    {
    }
    static void *handler_sock(void *args)
    {
    }
    void loop()
    { ll
    }
    ~tcp_server()
    {
    }

private:
    InetAddr _local_addr;
    std::unique_ptr<mysocket> _listen_sock;
    bool _isrunning;
};